<template>
  <div class="inject-con" :style="animateStyle" @click="onTemplateClick($event)" ref="injectTemplate" :class="getTemplateClass" :id="item.id">
    <slot name="common"></slot>
    <div class="click-statics" v-if="isH5Edit && isDisplayClickStatics">
      {{ clickStatics[item.id] ? clickStatics[item.id].val : 0 }}
    </div>
  </div>
</template>

<script>
import { commonUtils } from '@/components/utils/common-utils'
import { utils } from '@/components/utils/utils'
import { pageTemplate } from '@/components/utils/page-template'
import { template } from '@/components/utils/template'
import { wbBase } from '@/components/utils/wbBase'
import { COMPONENT_TYPES } from '@/common/const-wb'
import { reactive } from 'vue'

export default {
  name: 'InjectTemplate',
  mixins: [commonUtils, utils, pageTemplate, template, wbBase],
  setup () {
    const state =  reactive({
      isScrollAnimateClass: false,
      isCssAnimateClass: false,
    })
    const state_ = {
      animateStyle: {},
      COMPONENT_TYPES: COMPONENT_TYPES,
    }
    _.merge(state, state_)
    return state
  },
}
</script>

<style lang="scss">
.inject-con{
  width: inherit;
  height: inherit;
}
.transform-center {
  transform-origin: center center;
}
.isHiddenComp{
  display: none;
}
.click-statics{
  position: absolute;
  top: 10px;
  left: 10px;
  color: #fff;
  font-size: 40px;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 100;
  padding: 4px 24px;
  border: 4px solid red;
  border-radius: 0px 30px 50px 8px;
  font-weight: bold;
  background-image: linear-gradient(180deg, #000 0%, rgba(255,255,255,0.00) 100%);
  box-shadow: -5px -5px 15px 0 #928f8f, 5px 5px 15px 0 #D7D5D1, inset 0 -2px 2px 0 rgba(0,0,0,0.10), inset 0 -20px 15px 0 rgba(226,223,221,0.50);
}
</style>
